<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://unpkg.com/vue@next"></script>
</head>
<body>
    <div id="app">
        <base-layout>
            <template v-slot:header>
                <h1>Here might be a page title</h1>
            </template>
            <template v-slot:main>
                <p>A paragraph for the main content.</p>
                <p>And another one.</p>
            </template>
            <template v-slot:footer>
                <p>Here's some contact info</p>
            </template>
        </base-layout>
    </div>

    <script>
        const AppComp={
            data() {
                return {
                    
                }
            },
        }

        const BaseLayoutComp={
            template:`
                <header>
                    <span>我们希望把页头放这里</span>
                    <slot name='header'></slot>
                </header>
                <main>
                    <span>我们希望把主要内容放这里</span>
                    <slot name='main'></slot>
                </main>
                <footer>
                    <span>我们希望把页脚放这里</span>
                    <slot name='footer'></slot>
                </footer>
            `
        }

        const app = Vue.createApp(AppComp)
        app.component("base-layout",BaseLayoutComp)
        const vm = app.mount("#app")
    </script>
</body>
</html>